| Parameter | Base model |
|---|---|
| swang1 (RHC) | 1.16 [1.01, 1.32], p =0.030 |
| cat chf (Others) | 1.71 [1.29, 2.25], p <0.001 |
| age | 1.03 [1.03, 1.04], p <0.001 |
| Observations | 5733 |
多変量回帰・・・好きですか?
2025-08-11
古くから研究されつくされており、信頼感がある
多くの統計ソフトに入っており、行うのが簡単
解釈性が高く、分かりやすい
本当?
Many regression species
| Parameter | Base model |
|---|---|
| swang1 (RHC) | 1.16 [1.01, 1.32], p =0.030 |
| cat chf (Others) | 1.71 [1.29, 2.25], p <0.001 |
| age | 1.03 [1.03, 1.04], p <0.001 |
| Observations | 5733 |
| Parameter | Base model | Interact model |
|---|---|---|
| swang1 (RHC) | 1.16 [1.01, 1.32], p =0.030 | 1.52 [1.02, 2.26], p =0.041 |
| cat chf (Others) | 1.71 [1.29, 2.25], p <0.001 | 1.94 [1.40, 2.69], p <0.001 |
| age | 1.03 [1.03, 1.04], p <0.001 | 1.03 [1.03, 1.04], p <0.001 |
| swang1 (RHC) × cat chf (Others) | 0.74 [0.49, 1.12], p =0.158 | |
| Observations | 5733 | 5733 |
| Parameter | Base model | Interact model | Spline model |
|---|---|---|---|
| swang1 (RHC) | 1.16 [1.01, 1.32], p =0.030 | 1.52 [1.02, 2.26], p =0.041 | 1.49 [1.00, 2.23], p =0.049 |
| cat chf (Others) | 1.71 [1.29, 2.25], p <0.001 | 1.94 [1.40, 2.69], p <0.001 | 1.94 [1.40, 2.70], p <0.001 |
| age | 1.03 [1.03, 1.04], p <0.001 | 1.03 [1.03, 1.04], p <0.001 | |
| swang1 (RHC) × cat chf (Others) | 0.74 [0.49, 1.12], p =0.158 | 0.75 [0.49, 1.14], p =0.172 | |
| rcs(age ( degree) | 0.99 [0.96, 1.01], p =0.325 | ||
| rcs(age ( degree) | 1.04 [0.89, 1.21], p =0.611 | ||
| rcs(age ( degree) | 1.04 [1.03, 1.05], p <0.001 | ||
| Observations | 5733 | 5733 | 5733 |
# A tibble: 5,733 × 6
rowid swang1 estimate conf.low conf.high death_01
<int> <chr> <dbl> <dbl> <dbl> <dbl>
1 1 No RHC 0.606 0.535 0.672 0
2 2 RHC 0.839 0.787 0.880 1
3 3 RHC 0.743 0.675 0.801 0
4 4 No RHC 0.746 0.684 0.800 1
5 5 RHC 0.872 0.830 0.904 1
6 6 No RHC 0.780 0.721 0.829 0
7 7 No RHC 0.585 0.519 0.648 0
8 8 No RHC 0.287 0.231 0.350 1
9 9 No RHC 0.315 0.247 0.394 0
10 10 RHC 0.593 0.535 0.648 0
# ℹ 5,723 more rows
# A tibble: 11,466 × 6
rowid swang1 estimate conf.low conf.high death_01
<int> <chr> <dbl> <dbl> <dbl> <dbl>
1 1 No RHC 0.606 0.535 0.672 0
2 2 No RHC 0.823 0.768 0.868 1
3 3 No RHC 0.721 0.651 0.782 0
4 4 No RHC 0.746 0.684 0.800 1
5 5 No RHC 0.859 0.815 0.893 1
6 6 No RHC 0.780 0.721 0.829 0
7 7 No RHC 0.585 0.519 0.648 0
8 8 No RHC 0.287 0.231 0.350 1
9 9 No RHC 0.315 0.247 0.394 0
10 10 No RHC 0.567 0.508 0.623 0
# ℹ 11,456 more rows
swang1 Estimate Std. Error z Pr(>|z|) S 2.5 % 97.5 %
No RHC 0.638 0.00792 80.5 <0.001 Inf 0.623 0.654
RHC 0.666 0.01034 64.4 <0.001 Inf 0.645 0.686
Type: response
Risk ratio
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.04 0.0433 4.5 1 1.09
Term: swang1
Type: response
Comparison: ln(mean(RHC) / mean(No RHC))
Odds ratio
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.13 0.0454 4.5 1 1.27
Term: swang1
Type: response
Comparison: ln(odds(RHC) / odds(No RHC))
# A tibble: 10,554 × 7
rowid swang1 cat_chf estimate conf.low conf.high death_01
<int> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 1 No RHC Others 0.606 0.535 0.672 0
2 2 No RHC Others 0.823 0.768 0.868 1
3 3 No RHC Others 0.721 0.651 0.782 0
4 4 No RHC Others 0.746 0.684 0.800 1
5 5 No RHC Others 0.859 0.815 0.893 1
6 6 No RHC Others 0.780 0.721 0.829 0
7 7 No RHC Others 0.585 0.519 0.648 0
8 8 No RHC Others 0.287 0.231 0.350 1
9 9 No RHC Others 0.315 0.247 0.394 0
10 10 No RHC Others 0.567 0.508 0.623 0
# ℹ 10,544 more rows
swang1 Estimate Std. Error z Pr(>|z|) S 2.5 % 97.5 %
No RHC 0.562 0.0306 18.3 <0.001 247.4 0.502 0.622
RHC 0.651 0.0317 20.5 <0.001 307.8 0.588 0.713
Type: response
# A tibble: 456 × 6
swang1 cat_chf estimate conf.low conf.high death_01
<chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 RHC CHF 0.0967 0.000843 0.193 1
2 No RHC CHF 0.0904 0.00145 0.179 1
3 No RHC CHF 0.0793 0.00122 0.157 0
4 No RHC CHF 0.0945 0.000226 0.189 1
5 No RHC CHF 0.100 0.00131 0.199 0
6 No RHC CHF 0.0998 0.00141 0.198 0
7 No RHC CHF 0.0954 0.00136 0.189 1
8 RHC CHF 0.0949 0.00119 0.189 0
9 No RHC CHF 0.0919 0.00161 0.182 1
10 No RHC CHF 0.0816 0.000612 0.163 1
# ℹ 446 more rows
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.16 0.0474 4.4 1 1.34
Term: swang1
Type: response
Comparison: ln(mean(RHC) / mean(No RHC))
A `matchit` object
- method: 1:1 nearest neighbor matching without replacement
- distance: Propensity score
- estimated with logistic regression
- number of obs.: 5733 (original), 4366 (matched)
- target estimand: ATT
- covariates: cat_chf, age, sex, race, edu, income, wtkilo1, temp1, meanbp1, resp1, hrt1, pafi1, paco21, ph1, wblc1, hema1, sod1, pot1, crea1, bili1, alb1, cardiohx, chfhx, immunhx, transhx, amihx
matched data
# A tibble: 4,366 × 6
death_yn swang1 cat_chf age distance weights
<dbl> <chr> <chr> <dbl> <dbl> <dbl>
1 0 No RHC Others 70.3 0.502 1
2 1 RHC Others 78.2 0.563 1
3 0 RHC Others 46.1 0.402 1
4 1 No RHC Others 75.3 0.344 1
5 1 RHC Others 67.9 0.302 1
6 0 No RHC Others 55.0 0.379 1
7 1 No RHC Others 43.6 0.281 1
8 0 No RHC Others 18.0 0.283 1
9 0 RHC Others 48.4 0.490 1
10 0 No RHC Others 34.4 0.393 1
# ℹ 4,356 more rows
アウトカムモデル
Call:
glm(formula = death_01 ~ swang1 * cat_chf + rcs(age, 4) + crea1 +
sex + race + edu + income + wtkilo1 + temp1 + meanbp1 + resp1 +
hrt1 + pafi1 + paco21 + ph1 + wblc1 + hema1 + sod1 + pot1 +
bili1 + alb1 + cardiohx + chfhx + immunhx + transhx + amihx,
family = binomial, data = dat_m, weights = weights)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 8.3720758 3.0519820 2.743 0.006085 **
swang1RHC 0.2979878 0.2142302 1.391 0.164234
cat_chfOthers 0.6272870 0.1929188 3.252 0.001148 **
rcs(age, 4)age 0.0460262 0.0073111 6.295 3.07e-10 ***
rcs(age, 4)age' -0.0300047 0.0153201 -1.959 0.050169 .
rcs(age, 4)age'' 0.1399522 0.0931435 1.503 0.132957
crea1 0.0105633 0.0179507 0.588 0.556221
sexMale 0.2461617 0.0722525 3.407 0.000657 ***
raceother 0.1766005 0.1651406 1.069 0.284892
racewhite 0.0327267 0.0998068 0.328 0.742987
edu 0.0143607 0.0127289 1.128 0.259236
income$11-$25k 0.0940105 0.1417030 0.663 0.507053
income$25-$50k -0.0403601 0.1402408 -0.288 0.773506
incomeUnder $11k 0.3384458 0.1377695 2.457 0.014026 *
wtkilo1 -0.0051664 0.0013121 -3.937 8.23e-05 ***
temp1 -0.0980770 0.0211773 -4.631 3.63e-06 ***
meanbp1 -0.0033602 0.0009997 -3.361 0.000776 ***
resp1 0.0063613 0.0025859 2.460 0.013895 *
hrt1 0.0028575 0.0009159 3.120 0.001809 **
pafi1 0.0005013 0.0003571 1.404 0.160424
paco21 0.0004425 0.0038424 0.115 0.908323
ph1 -1.0754772 0.3902359 -2.756 0.005852 **
wblc1 0.0015517 0.0028332 0.548 0.583905
hema1 -0.0201725 0.0049354 -4.087 4.36e-05 ***
sod1 0.0034946 0.0046319 0.754 0.450575
pot1 0.0548594 0.0369037 1.487 0.137132
bili1 0.0572166 0.0093037 6.150 7.75e-10 ***
alb1 0.0149816 0.0517212 0.290 0.772075
cardiohx 0.0058533 0.1012471 0.058 0.953898
chfhx 0.4574501 0.1187363 3.853 0.000117 ***
immunhx 0.2341199 0.0796956 2.938 0.003307 **
transhx -0.3824780 0.0967037 -3.955 7.65e-05 ***
amihx -0.3281233 0.1715791 -1.912 0.055828 .
swang1RHC:cat_chfOthers -0.2139280 0.2264226 -0.945 0.344752
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5552.0 on 4365 degrees of freedom
Residual deviance: 5064.5 on 4332 degrees of freedom
AIC: 5132.5
Number of Fisher Scoring iterations: 4
# A tibble: 4,366 × 8
rowid contrast estimate conf.low conf.high death_01 swang1 weights
<int> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl>
1 1 RHC - No RHC 0.0196 -0.0137 0.0529 0 No RHC 1
2 2 RHC - No RHC 0.0120 -0.00850 0.0324 1 RHC 1
3 3 RHC - No RHC 0.0163 -0.0115 0.0441 0 RHC 1
4 4 RHC - No RHC 0.0156 -0.0110 0.0422 1 No RHC 1
5 5 RHC - No RHC 0.00965 -0.00700 0.0263 1 RHC 1
6 6 RHC - No RHC 0.0193 -0.0134 0.0519 0 No RHC 1
7 7 RHC - No RHC 0.0169 -0.0120 0.0458 1 No RHC 1
8 8 RHC - No RHC 0.0177 -0.0126 0.0480 0 No RHC 1
9 9 RHC - No RHC 0.0201 -0.0140 0.0543 0 RHC 1
10 10 RHC - No RHC 0.0197 -0.0139 0.0533 0 No RHC 1
# ℹ 4,356 more rows
ここから計算する
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.03 0.122 3.0 0.992 1.07
Term: swang1
Type: response
Comparison: ln(mean(RHC) / mean(No RHC))
# A tibble: 2,183 × 8
rowid contrast estimate conf.low conf.high death_01 swang1 weights
<int> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl>
1 1 RHC - No RHC 0.0120 -0.00850 0.0324 1 RHC 1
2 2 RHC - No RHC 0.0163 -0.0115 0.0441 0 RHC 1
3 3 RHC - No RHC 0.00965 -0.00700 0.0263 1 RHC 1
4 4 RHC - No RHC 0.0201 -0.0140 0.0543 0 RHC 1
5 5 RHC - No RHC 0.0207 -0.0145 0.0560 0 RHC 1
6 6 RHC - No RHC 0.0199 -0.0140 0.0538 1 RHC 1
7 7 RHC - No RHC 0.00868 -0.00604 0.0234 1 RHC 1
8 8 RHC - No RHC 0.0165 -0.0115 0.0446 1 RHC 1
9 9 RHC - No RHC 0.0146 -0.0106 0.0399 0 RHC 1
10 10 RHC - No RHC 0.0206 -0.0143 0.0556 1 RHC 1
# ℹ 2,173 more rows
ここから計算する
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.03 0.121 3.0 0.992 1.07
Term: swang1
Type: response
Comparison: ln(mean(RHC) / mean(No RHC))
# A tibble: 2,183 × 8
rowid contrast estimate conf.low conf.high death_01 swang1 weights
<int> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl>
1 1 RHC - No RHC 0.0196 -0.0137 0.0529 0 No RHC 1
2 2 RHC - No RHC 0.0156 -0.0110 0.0422 1 No RHC 1
3 3 RHC - No RHC 0.0193 -0.0134 0.0519 0 No RHC 1
4 4 RHC - No RHC 0.0169 -0.0120 0.0458 1 No RHC 1
5 5 RHC - No RHC 0.0177 -0.0126 0.0480 0 No RHC 1
6 6 RHC - No RHC 0.0197 -0.0139 0.0533 0 No RHC 1
7 7 RHC - No RHC 0.0210 -0.0146 0.0565 1 No RHC 1
8 8 RHC - No RHC 0.0203 -0.0143 0.0550 0 No RHC 1
9 9 RHC - No RHC 0.0124 -0.00937 0.0342 0 No RHC 1
10 10 RHC - No RHC 0.0642 -0.0284 0.157 1 No RHC 1
# ℹ 2,173 more rows
ここから計算する
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.03 0.123 3.0 0.992 1.07
Term: swang1
Type: response
Comparison: ln(mean(RHC) / mean(No RHC))
A weightit object
- method: "glm" (propensity score weighting with GLM)
- number of obs.: 5733
- sampling weights: none
- treatment: 2-category
- estimand: ATE
- covariates: cat_chf, age, sex, race, edu, income, wtkilo1, temp1, meanbp1, resp1, hrt1, pafi1, paco21, ph1, wblc1, hema1, sod1, pot1, crea1, bili1, alb1, cardiohx, chfhx, immunhx, transhx, amihx
# A tibble: 5,733 × 8
death_01 swang_yn age sex race cat_chf crea1 weights
<dbl> <dbl> <dbl> <chr> <chr> <chr> <dbl> <dbl>
1 0 0 70.3 Male white Others 1.20 2.01
2 1 1 78.2 Female white Others 0.600 1.78
3 0 1 46.1 Female white Others 2.60 2.49
4 1 0 75.3 Female white Others 1.70 1.53
5 1 1 67.9 Male white Others 3.60 3.31
6 0 0 86.1 Female white Others 1.40 1.12
7 0 0 55.0 Male white Others 1 1.61
8 1 0 43.6 Male white Others 0.700 1.39
9 0 0 18.0 Female white Others 1.70 1.39
10 0 1 48.4 Female white Others 0.5 2.04
# ℹ 5,723 more rows
Call:
WeightIt::glm_weightit(formula = death_01 ~ swang1 * cat_chf +
rcs(age, 4) + crea1 + sex + race + edu + income + wtkilo1 +
temp1 + meanbp1 + resp1 + hrt1 + pafi1 + paco21 + ph1 + wblc1 +
hema1 + sod1 + pot1 + bili1 + alb1 + cardiohx + chfhx + immunhx +
transhx + amihx, data = rhc_prep, family = binomial, weightit = wout_ate)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 6.2431313 3.1407162 1.988 0.046833 *
swang1RHC 0.4213975 0.2232617 1.887 0.059098 .
cat_chfOthers 0.5554860 0.1934359 2.872 0.004083 **
rcs(age, 4)age 0.0387122 0.0081293 4.762 1.92e-06 ***
rcs(age, 4)age' -0.0153697 0.0165989 -0.926 0.354474
rcs(age, 4)age'' 0.0599765 0.0973430 0.616 0.537805
crea1 0.0131695 0.0211148 0.624 0.532819
sexMale 0.2002275 0.0756056 2.648 0.008089 **
raceother 0.1047433 0.1674566 0.625 0.531646
racewhite -0.0776023 0.1063510 -0.730 0.465585
edu 0.0280096 0.0128521 2.179 0.029303 *
income$11-$25k 0.2348404 0.1495633 1.570 0.116375
income$25-$50k -0.0426852 0.1499175 -0.285 0.775855
incomeUnder $11k 0.4149254 0.1478977 2.805 0.005024 **
wtkilo1 -0.0032067 0.0014755 -2.173 0.029760 *
temp1 -0.0830270 0.0228051 -3.641 0.000272 ***
meanbp1 -0.0034465 0.0010272 -3.355 0.000793 ***
resp1 0.0038987 0.0026314 1.482 0.138445
hrt1 0.0029678 0.0009275 3.200 0.001375 **
pafi1 0.0005517 0.0003901 1.414 0.157261
paco21 -0.0042080 0.0037603 -1.119 0.263106
ph1 -0.7636761 0.3988971 -1.914 0.055560 .
wblc1 0.0007086 0.0029638 0.239 0.811040
hema1 -0.0259974 0.0052143 -4.986 < 1e-06 ***
sod1 0.0015924 0.0046547 0.342 0.732264
pot1 0.0750655 0.0403091 1.862 0.062568 .
bili1 0.0595551 0.0105584 5.641 < 1e-06 ***
alb1 -0.0196740 0.0551163 -0.357 0.721126
cardiohx -0.0686531 0.1058839 -0.648 0.516739
chfhx 0.5082114 0.1241712 4.093 4.26e-05 ***
immunhx 0.2218184 0.0795369 2.789 0.005289 **
transhx -0.3666306 0.0984877 -3.723 0.000197 ***
amihx -0.1936546 0.1720359 -1.126 0.260308
swang1RHC:cat_chfOthers -0.2871238 0.2391748 -1.200 0.229954
Standard error: HC0 robust (adjusted for estimation of weights)
Risk ratio and 95% confidence interval
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.05 0.0291 5.1 1 1.1
Term: swang1
Type: probs
Comparison: ln(mean(RHC) / mean(No RHC))
A weightit object
- method: "glm" (propensity score weighting with GLM)
- number of obs.: 5733
- sampling weights: none
- treatment: 2-category
- estimand: ATT (focal: 1)
- covariates: cat_chf, age, sex, race, edu, income, wtkilo1, temp1, meanbp1, resp1, hrt1, pafi1, paco21, ph1, wblc1, hema1, sod1, pot1, crea1, bili1, alb1, cardiohx, chfhx, immunhx, transhx, amihx
# A tibble: 5,733 × 8
death_01 swang_yn age sex race cat_chf crea1 weights
<dbl> <dbl> <dbl> <chr> <chr> <chr> <dbl> <dbl>
1 0 0 70.3 Male white Others 1.20 1.01
2 1 1 78.2 Female white Others 0.600 1
3 0 1 46.1 Female white Others 2.60 1
4 1 0 75.3 Female white Others 1.70 0.526
5 1 1 67.9 Male white Others 3.60 1
6 0 0 86.1 Female white Others 1.40 0.117
7 0 0 55.0 Male white Others 1 0.611
8 1 0 43.6 Male white Others 0.700 0.392
9 0 0 18.0 Female white Others 1.70 0.394
10 0 1 48.4 Female white Others 0.5 1
# ℹ 5,723 more rows
Call:
WeightIt::glm_weightit(formula = death_01 ~ swang1 * cat_chf +
rcs(age, 4) + crea1 + sex + race + edu + income + wtkilo1 +
temp1 + meanbp1 + resp1 + hrt1 + pafi1 + paco21 + ph1 + wblc1 +
hema1 + sod1 + pot1 + bili1 + alb1 + cardiohx + chfhx + immunhx +
transhx + amihx, data = rhc_prep, family = binomial, weightit = wout_att)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 8.6468892 3.2275906 2.679 0.007383 **
swang1RHC 0.2313120 0.2461137 0.940 0.347290
cat_chfOthers 0.5490938 0.2382303 2.305 0.021173 *
rcs(age, 4)age 0.0487811 0.0077472 6.297 < 1e-06 ***
rcs(age, 4)age' -0.0297895 0.0165337 -1.802 0.071585 .
rcs(age, 4)age'' 0.1139380 0.1052456 1.083 0.278990
crea1 0.0060007 0.0246616 0.243 0.807755
sexMale 0.2465548 0.0769534 3.204 0.001356 **
raceother 0.0313990 0.1767677 0.178 0.859015
racewhite -0.1276454 0.1069158 -1.194 0.232522
edu 0.0269046 0.0133725 2.012 0.044227 *
income$11-$25k -0.0033263 0.1483589 -0.022 0.982112
income$25-$50k -0.0861141 0.1484533 -0.580 0.561864
incomeUnder $11k 0.2440442 0.1463484 1.668 0.095404 .
wtkilo1 -0.0061903 0.0015972 -3.876 0.000106 ***
temp1 -0.0861481 0.0229575 -3.753 0.000175 ***
meanbp1 -0.0034707 0.0010540 -3.293 0.000991 ***
resp1 0.0066936 0.0028555 2.344 0.019074 *
hrt1 0.0023754 0.0010015 2.372 0.017702 *
pafi1 0.0005454 0.0004103 1.329 0.183791
paco21 -0.0035279 0.0037666 -0.937 0.348952
ph1 -1.1114260 0.4016787 -2.767 0.005658 **
wblc1 0.0024665 0.0027953 0.882 0.377565
hema1 -0.0214227 0.0053264 -4.022 5.77e-05 ***
sod1 0.0026557 0.0048592 0.547 0.584699
pot1 0.0727514 0.0415130 1.752 0.079688 .
bili1 0.0604808 0.0107892 5.606 < 1e-06 ***
alb1 -0.0395979 0.0546219 -0.725 0.468485
cardiohx 0.0564933 0.1115853 0.506 0.612661
chfhx 0.4867779 0.1401276 3.474 0.000513 ***
immunhx 0.2014825 0.0875316 2.302 0.021345 *
transhx -0.3366241 0.1055305 -3.190 0.001424 **
amihx -0.3235800 0.1851544 -1.748 0.080529 .
swang1RHC:cat_chfOthers -0.1254310 0.2589720 -0.484 0.628143
Standard error: HC0 robust (adjusted for estimation of weights)
Risk ratio and 95% confidence interval
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.04 0.115 3.1 0.991 1.08
Term: swang1
Type: probs
Comparison: ln(mean(RHC) / mean(No RHC))
A weightit object
- method: "glm" (propensity score weighting with GLM)
- number of obs.: 5733
- sampling weights: none
- treatment: 2-category
- estimand: ATC (focal: 0)
- covariates: cat_chf, age, sex, race, edu, income, wtkilo1, temp1, meanbp1, resp1, hrt1, pafi1, paco21, ph1, wblc1, hema1, sod1, pot1, crea1, bili1, alb1, cardiohx, chfhx, immunhx, transhx, amihx
# A tibble: 5,733 × 8
death_01 swang_yn age sex race cat_chf crea1 weights
<dbl> <dbl> <dbl> <chr> <chr> <chr> <dbl> <dbl>
1 0 0 70.3 Male white Others 1.20 1
2 1 1 78.2 Female white Others 0.600 0.777
3 0 1 46.1 Female white Others 2.60 1.49
4 1 0 75.3 Female white Others 1.70 1
5 1 1 67.9 Male white Others 3.60 2.31
6 0 0 86.1 Female white Others 1.40 1
7 0 0 55.0 Male white Others 1 1
8 1 0 43.6 Male white Others 0.700 1
9 0 0 18.0 Female white Others 1.70 1
10 0 1 48.4 Female white Others 0.5 1.04
# ℹ 5,723 more rows
Call:
WeightIt::glm_weightit(formula = death_01 ~ swang1 * cat_chf +
rcs(age, 4) + crea1 + sex + race + edu + income + wtkilo1 +
temp1 + meanbp1 + resp1 + hrt1 + pafi1 + paco21 + ph1 + wblc1 +
hema1 + sod1 + pot1 + bili1 + alb1 + cardiohx + chfhx + immunhx +
transhx + amihx, data = rhc_prep, family = binomial, weightit = wout_atc)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.2139813 3.7473840 1.125 0.260796
swang1RHC 0.5771091 0.2328870 2.478 0.013210 *
cat_chfOthers 0.5915078 0.1898688 3.115 0.001837 **
rcs(age, 4)age 0.0332256 0.0093838 3.541 0.000399 ***
rcs(age, 4)age' -0.0074427 0.0190591 -0.391 0.696162
rcs(age, 4)age'' 0.0298757 0.1088120 0.275 0.783653
crea1 0.0224478 0.0225776 0.994 0.320099
sexMale 0.1741977 0.0861000 2.023 0.043052 *
raceother 0.1419371 0.1843876 0.770 0.441433
racewhite -0.0438198 0.1221636 -0.359 0.719821
edu 0.0285804 0.0145419 1.965 0.049369 *
income$11-$25k 0.3960766 0.1745643 2.269 0.023272 *
income$25-$50k -0.0135415 0.1768372 -0.077 0.938961
incomeUnder $11k 0.5366253 0.1729339 3.103 0.001915 **
wtkilo1 -0.0017586 0.0016487 -1.067 0.286118
temp1 -0.0796040 0.0263993 -3.015 0.002567 **
meanbp1 -0.0033540 0.0011348 -2.956 0.003121 **
resp1 0.0021765 0.0029054 0.749 0.453777
hrt1 0.0033948 0.0010413 3.260 0.001114 **
pafi1 0.0005489 0.0004467 1.229 0.219155
paco21 -0.0036611 0.0041598 -0.880 0.378800
ph1 -0.4927880 0.4780367 -1.031 0.302607
wblc1 -0.0004794 0.0037160 -0.129 0.897355
hema1 -0.0280287 0.0059791 -4.688 2.76e-06 ***
sod1 0.0006330 0.0052550 0.120 0.904116
pot1 0.0763670 0.0467941 1.632 0.102684
bili1 0.0586712 0.0118855 4.936 < 1e-06 ***
alb1 -0.0068194 0.0650514 -0.105 0.916510
cardiohx -0.1621082 0.1189444 -1.363 0.172917
chfhx 0.5165472 0.1373658 3.760 0.000170 ***
immunhx 0.2322479 0.0877537 2.647 0.008131 **
transhx -0.3913542 0.1102084 -3.551 0.000384 ***
amihx -0.0822611 0.1879259 -0.438 0.661581
swang1RHC:cat_chfOthers -0.4241877 0.2533146 -1.675 0.094023 .
Standard error: HC0 robust (adjusted for estimation of weights)
Risk ratio and 95% confidence interval
Estimate Pr(>|z|) S 2.5 % 97.5 %
1.06 0.0271 5.2 1.01 1.12
Term: swang1
Type: probs
Comparison: ln(mean(RHC) / mean(No RHC))
モデルの中身
══ Workflow [trained] ══════════════════════════════════════════════════════════
Preprocessor: Variables
Model: boost_tree()
── Preprocessor ────────────────────────────────────────────────────────────────
Outcomes: death_01
Predictors: c("age", "crea1", "edu", "wtkilo1", "temp1", "meanbp1", "resp1",
"hrt1", "pafi1", "paco21", "ph1", "wblc1", "hema1", "sod1",
"pot1", "bili1", "alb1", "cardiohx", "chfhx", "immunhx",
"transhx", "amihx", "swang1_RHC", "cat_chf_Others", "cat1_CHF",
"cat1_Cirrhosis", "cat1_Colon.Cancer", "cat1_Coma", "cat1_COPD",
"cat1_Lung.Cancer", "cat1_MOSF.w.Malignancy", "cat1_MOSF.w.Sepsis",
"sex_Male", "race_other", "race_white", "income_X.11..25k",
"income_X.25..50k", "income_Under..11k")
── Model ───────────────────────────────────────────────────────────────────────
##### xgb.Booster
raw: 51.4 Kb
call:
xgboost::xgb.train(params = list(eta = 0.3, max_depth = 6, gamma = 0,
colsample_bytree = 1, colsample_bynode = 1, min_child_weight = 1,
subsample = 1), data = x$data, nrounds = 15, watchlist = x$watchlist,
verbose = 0, nthread = 1, objective = "binary:logistic")
params (as set within xgb.train):
eta = "0.3", max_depth = "6", gamma = "0", colsample_bytree = "1", colsample_bynode = "1", min_child_weight = "1", subsample = "1", nthread = "1", objective = "binary:logistic", validate_parameters = "TRUE"
xgb.attributes:
niter
callbacks:
cb.evaluation.log()
# of features: 38
niter: 15
nfeatures : 38
evaluation_log:
iter training_logloss
<num> <num>
1 0.6358522
2 0.6015622
--- ---
14 0.4678196
15 0.4606318
# A tibble: 11,466 × 32
rowidcf death_yn death_days swang_yn cat_chf cat1 age crea1 sex race
<int> <dbl> <dbl> <dbl> <chr> <chr> <dbl> <dbl> <chr> <chr>
1 1 0 180 0 Others COPD 70.3 1.20 Male white
2 2 1 45 1 Others MOSF w/… 78.2 0.600 Fema… white
3 3 0 180 1 Others MOSF w/… 46.1 2.60 Fema… white
4 4 1 37 0 Others ARF 75.3 1.70 Fema… white
5 5 1 2 1 Others MOSF w/… 67.9 3.60 Male white
6 6 0 180 0 Others COPD 86.1 1.40 Fema… white
7 7 0 180 0 Others MOSF w/… 55.0 1 Male white
8 8 1 38 0 Others ARF 43.6 0.700 Male white
9 9 0 180 0 Others MOSF w/… 18.0 1.70 Fema… white
10 10 0 180 1 Others ARF 48.4 0.5 Fema… white
# ℹ 11,456 more rows
# ℹ 22 more variables: edu <dbl>, income <chr>, wtkilo1 <dbl>, temp1 <dbl>,
# meanbp1 <dbl>, resp1 <dbl>, hrt1 <int>, pafi1 <dbl>, paco21 <dbl>,
# ph1 <dbl>, wblc1 <dbl>, hema1 <dbl>, sod1 <int>, pot1 <dbl>, bili1 <dbl>,
# alb1 <dbl>, cardiohx <int>, chfhx <int>, immunhx <int>, transhx <int>,
# amihx <int>, swang1 <chr>
# A tibble: 11,466 × 4
swang1 death_01 probability_1 predicted_class
<chr> <fct> <dbl> <fct>
1 No RHC 0 0.536 1
2 No RHC 1 0.737 1
3 No RHC 0 0.570 1
4 No RHC 1 0.628 1
5 No RHC 1 0.726 1
6 No RHC 0 0.732 1
7 No RHC 0 0.531 1
8 No RHC 1 0.253 0
9 No RHC 0 0.369 0
10 No RHC 0 0.400 0
# ℹ 11,456 more rows
# A tibble: 2 × 2
swang1 mean_death_prob
<chr> <dbl>
1 No RHC 0.642
2 RHC 0.655
すべてのモデルは誤っている。しかし、そのうちのいくつかは役に立つ。
emmeans, marginaleffects, easystatsのmodelbasedなどmarginaleffects